﻿//初始化
var fun = "";
if (typeof ($) != "undefined") {
    $(document).ready(function () {

    });
    instance[0].EditDate = new Date();
    instance[0].AddTime = new Date();

    fun = getPar1("fun");
    if (fun == "view") {
        parent.setButtonHiden();
        $("div input").attr("disabled", true).css("background", "whitesmoke");
        $("div textarea").css("background", "whitesmoke");
        $("div select").attr("disabled", true).css("background", "whitesmoke");
        $("div input[type=button]").hide();
    }
}

//查看方案明细
var fnViewSolutionItem = function () {
    //debugger;
    var solutionID = $("#SolutionID").val();
    var solutionName = $("#SolutionID").find("option:selected").text();
    var pagetitle = "查看考核方案【" + solutionName+"】";
    parent.parent._employeeTitle = pagetitle;
    parent.parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=ExaminationSolution&fun=view" + "&id=" + solutionID));
    parent.parent.NeedRefreshPage = this;
}

//查看方案标准
var fnViewSolutionStandard = function () {
    var solutionID = $("#SolutionID").val();
    var solutionName = $("#SolutionID").find("option:selected").text();
    var pagetitle = "查看考核方案【" + solutionName + "】的考核标准";
    parent.parent._employeeTitle = pagetitle;
    parent.parent.addTabs(pagetitle, encodeURI("../EHR/hrExaminationStandard.aspx?solutionID=" + solutionID + "&solutionName=" + solutionName + "&fun=view"));
    parent.parent.NeedRefreshPage = this;
}

var fnCheckData = function () {
    try {
        if ($("#Caption").val() == "") {
            return "计划名字不能为空！";
        }
        if ($("#BeginDate").val() == "") {
            return "开始日期不能为空！";
        }
        if (!isDateFormat($("#BeginDate").val())) {
            return "开始日期非日期格式！";
        }
        if ($("#EndDate").val() == "") {
            return "结束日期不能为空！";
        }
        if (!isDateFormat($("#EndDate").val())) {
            return "结束日期非日期格式！";
        }
        if ($("#SolutionID").val() == "") {
            return "考核方案不能为空！";
        }


    }
    catch (e)
     { }
}




